import request from '/@/utils/request';

export default{
	getFileTree() {
		return request({
			url: '/mesher/editor/filetree',
			method: 'get',
			data: null,
		});
	},
	loadFile(caseUri: String) {
		return request({
			url: `/mesher/editor/loadfile?caseUri=${caseUri}`,
			method: 'get',
			data: null,
		});
	},
	saveFile(content: String,caseUri: String) {
		return request({
			url: `/mesher/editor/savefile?caseUri=${caseUri}`,
			method: 'post',
			data: content,
		});
	},
	newFile(caseUri: String) {
		return request({
			url: `/mesher/editor/newfile?caseUri=${caseUri}`,
			method: 'post',
			data: null,
		});
	},
	newFolder(caseUri: String) {
		return request({
			url: `/mesher/editor/newfolder?caseUri=${caseUri}`,
			method: 'post',
			data: null,
		});
	},
	deleteFile(caseUri: String) {
		return request({
			url: `/mesher/editor/deletefile?caseUri=${caseUri}`,
			method: 'post',
			data: null,
		});
	},
	run(cloudtest: any) {
		return request({
			url: `/mesher/editor/run`,
			method: 'post',
			data: cloudtest,
		});
	},
	restore() {
		return request({
			url: `/mesher/editor/restore`,
			method: 'post',
			data: null,
		});
	},
}
